package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.MetroAreaTarget;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.MetroAreaTargetBid;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class GxMetroAreaTarget extends MetroAreaTarget {
    public GxMetroAreaTarget(Element element) {
        NodeList bidsNode = element.getElementsByTagName("MetroAreaTargetBidCollection");
        if (bidsNode.getLength() > 0) {
            NodeList metroAreaTargetBidNode = ((Element)bidsNode.item(0)).getElementsByTagName("MetroAreaTargetBid");
            MetroAreaTargetBid[] metroAreaTargetBids = new MetroAreaTargetBid[metroAreaTargetBidNode.getLength()];
            for (int temp = 0; temp < metroAreaTargetBidNode.getLength(); temp++) {
                metroAreaTargetBids[temp] = new GxMetroAreaTargetBid((Element)metroAreaTargetBidNode.item(temp));
            }
            this.setBids(metroAreaTargetBids);
        }
    }
}
